www.gusucode.com > AspFaq在线帮助系统 V1.0 > AspFaq在线帮助系统 V1.0\code\Guest_Do.asp

    <!--#Include file="Include.asp"-->
<%
if request.Form.count>0 then
  dim Guest_Title,Guest_Content,Guest_Contact,Guest_Name
  Guest_Title=HTMLEncode(trim(request.Form("Guest_Title")))
  Guest_Content=HTMLEncode(trim(request.Form("Guest_Content")))
  Guest_Contact=HTMLEncode(trim(request.Form("Guest_Contact")))
  Guest_Name=HTMLEncode(trim(request.Form("Guest_Name")))
  call CheckString(Guest_Title,50,1,"请输入标题!","标题过长,请小于50个字符!")
  call CheckString(Guest_Contact,50,1,"请输入联系方式!","联系方式过长,请小于50个字符!")
  call CheckString(Guest_Name,20,1,"请输入您的昵称!","您的昵称过长,请小于20个字符!")
  call CheckString(Guest_Content,2000,1,"请输入留言内容!","留言内容过长,请小于2000个字符!")
  if i=1 then
    call pagend()
    response.End()
  end if
  sqlstr="select * from [Guest] where Guest_Title='"&Guest_Title&"' and Guest_Name='"&Guest_Name&"'"
  rs.open sqlstr,conn,1,3
  if rs.eof then
    application.Lock()
	rs.addnew
	rs("Guest_Title")=Guest_Title
	rs("Guest_Content")=Guest_Content
	rs("Guest_Contact")=Guest_Contact
	rs("Guest_Name")=Guest_Name
	rs("Guest_Ip")=Request.ServerVariables("REMOTE_ADDR")
	rs.update
	response.Write("留言成功!")
  else
    response.Write("该留言已经发表!")
  end if
  rs.close
  response.End()
end if
%>